#!/usr/bin/env node
const Koa=require('koa'),
      log=console.log,
      logger=require('./middleware/logger.js'),
      task=require('./lib/task.js');
const app=new Koa();
app.use(logger); 
app.use(async (ctx,next)=>{ //M-hello
  ctx.body='hello koa!task cost:'+await task()+'ms';
});
app.listen(8080);
app.use(logger); 
app.use(async (ctx,next)=>{ //M-hello
  ctx.body='hello koa!task cost:'+await task()+'ms';
});
